<template>
	<!-- 启动页面 -->
	<view class="init">
		<view class="init_image">
			<image src="../../static/init1.png.png" mode="widthFix"></image>
		</view>
	</view>
</template>
<script>
	// 
	export default {
		data() {
			return {
				// isVideo: true
			
				screenShow: null,
				videoContext: null,
				tiaoTime:3,
				Time: null
			}
		},
		onLoad() {
			// this.info()
			this.info();
			
		},
		onReady() {
			
		},
		watch:{
			// screenShow(newVal,oldVal){
			// 	if(newVal){
			// 		this.isScreenShow = 0;
					
			// 	}else{
			// 		this.isScreenShow = 1;
			// 		setTimeout(()=>{
			// 			this.init();
			// 		},1500)
					
			// 	}
			// }
		},
		methods: {
			
	
            info(){
				this.$apis.accountInfo().then(res=>{
					if(res.code == 200){
						this.screenShow = res.data.screenShow;
					    if(this.screenShow){
							uni.redirectTo({
								url: `/pages/advertising/advertising?screenShow=${this.screenShow}`
							})
						}else{
							this.screenShow = null;
								this.init();	
						}
						
					}
				})
			},
			init() {
				this.$apis.accountInfo().then(res => {
					if(res.code == 200){
						// debuggerd
						// 判断用户是否需要邀请码
						if (res.data.needInviteCode) {
							if(res.data.inviteCode){
								
								uni.switchTab({
									url: "../index/index"
								})
							}else{
								wx.redirectTo({
									url: "../invite/invite"
								})
							}
						} else {
							uni.switchTab({
								url: "../index/index"
							})
						}
					
					
					}else if(res.data == 500){
						uni.clearStorageSync();
					}
					
					console.log("个人信息成功", res)
				})
			},
			
			
		}
	}
</script>

<style lang="scss">

	.init{
		width: 750rpx;
		height: 100vh;
		background: #ffffff;
	}
	.initBox{
		width: 100%;
		height: 100vh;
	}
	.myVideoBox{
		  width: 100%;
		  height: 1334rpx;
		      position: relative;
	}
	.myVideoTop{
		width: 100%;
		height: calc(100vh - 1334rpx);
		background-color: #fff;
		display: flex;
		justify-content: center;
		align-items: center;
		image{
			width: 375rpx;
		}
	}
	.tiao{
		width: 190rpx;
		height: 88rpx;
		line-height: 88rpx;
		opacity: 1;
		background:rgba(0,0,0,.6);
		border-radius: 48rpx;
		font-size: 32rpx;
		font-family: Source Han Sans CN, Source Han Sans CN-Regular;
		font-weight: 400;
		text-align: CENTER;
		color: #ffffff;
		position: absolute;
		bottom: 30rpx;
		right: 20rpx;
		z-index: 9;
	}
	.myVideo{
		width: 100% !important;
		height: 100% !important;
	}
	.init_image{
		position: fixed;
		top: 50%;
		left: 50%;
		transform: translate(-50%,-50%);
	}
	.init_image image{
		width: 750rpx;
	}
</style>
